#include <stdio.h>
#include <stdlib.h>
//
// Created by win10 on 2025/1/3.
//
typedef char ElemType;
typedef  struct  BiNode
{  ElemType  data;
    struct  BiNode   *lchild,*rchild;
}BiNode,*BiTree;

BiTree createBiTree() {
    BiNode* t = (BiNode*)malloc(sizeof(BiNode));
    char c;
    scanf("%c",&c);
    if(c=='#') return NULL;
    t->data=c;
    t->lchild=createBiTree();
    t->rchild=createBiTree();
    return t;
}
void preorder(BiTree t) {
    if(t==NULL) return;
    printf("%c",t->data);
    preorder(t->lchild);
    preorder(t->rchild);
}
int main() {
    BiTree t = createBiTree();
    preorder(t);
}
